<!DOCTYPE html>
<html lang="en"
      xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>MyPetstore</title>
</head>
<body>
<div th:replace="common/top"></div>
<div id="BackLink">
    <a href="/catalog/view" class>Return to Main Menu</a>
</div>

<div id="Content">
    <div id="Catalog">

        <h2 th:text="${product.name}">Product的name属性</h2>

        <table class="rwd-table">
            <tr>
                <th>Item ID</th>
                <th>Product ID</th>
                <th>Description</th>
                <th>List Price</th>
                <th>&nbsp;</th>
            </tr>

            <tr th:each="item:${itemList}">
                <td>
                    <a th:href="@{/catalog/viewItem(itemId=${item.itemId})}" }>
                        <span th:text="${item.itemId}"></span>
                    </a>
                </td>
                <td th:text="${item.product.productId}">product.name</td>
                <td th:text="${item.attribute1} + ' ' + ${product.name}">
                </td>
                <!--                    <td th:text="${item.attribute1} + ' ' + ${item.attribute2} + ' ' + ${item.attribute3} + ' '-->
                <!--                               + ${item.attribute4} + ' ' + ${item.attribute5} + ' ' + ${product.name}">-->
                <!--                    </td>-->
                <td th:text="'$' + ${item.listPrice}">
                    <!--                        <fmt:formatNumber value="${item.listPrice}" pattern="$#,##0.00" /></td>-->

                <td th:if="${item.getStatus() eq 'F'}">
                    NOT FOR SALE
                </td>

                <td th:if="${item.stockQuantity eq 0}">
                    SELL OUT
                </td>

                <td th:if="${item.getStatus() != 'F' && item.stockQuantity != 0}">
                    <a class="btn" th:href="@{/cart/addItemToCart(workingItemId=${item.itemId})}">Add to Cart</a>
                    <!--                        <a class="btn" href="addItemToCart?workingItemId=${item.itemId}">Add to Cart</a>-->
                </td>
            </tr>

            <tr>
                <td>
                </td>
            </tr>
        </table>

    </div>
</div>
<div th:replace="common/bottom"></div>
</body>
</html>